home *** CD-ROM | disk | FTP | other *** search
/ Champak 103 / Vol 103.iso / games / starship.swf / scripts / DefineSprite_94 / frame_1 / DoAction.as
Text File  |  2010-03-13  |  571b  |  32 lines

  1. function init()
  2. {
  3.    var i = 1;
  4.    while(_root.cst.maxObjects >= i)
  5.    {
  6.       tellTarget("../object_" + i)
  7.       {
  8.          _root.temp.objectFrames = _totalframes;
  9.       }
  10.       if(Number(_root.temp.objectFrames) == 0)
  11.       {
  12.          _name = "object_" + i;
  13.          break;
  14.       }
  15.       i++;
  16.    }
  17.    gotoAndStop(1);
  18. }
  19. function hit()
  20. {
  21.    if(active == true)
  22.    {
  23.       _parent._parent._parent.ship.actShots += 3;
  24.       _parent._parent._parent.ship.refreshShots();
  25.       active = false;
  26.       play();
  27.    }
  28. }
  29. active = true;
  30. stop();
  31. init();
  32.